package com.yl.message.websocket

import org.slf4j.LoggerFactory
import org.springframework.http.server.ServerHttpRequest
import org.springframework.http.server.ServerHttpResponse
import org.springframework.web.socket.WebSocketHandler
import org.springframework.web.socket.server.HandshakeInterceptor
import java.lang.Exception

open class HttpHandShakeInterceptor: HandshakeInterceptor {

	private val log = LoggerFactory.getLogger(WebSocketServer::class.java)!!

	override fun beforeHandshake(
		request: ServerHttpRequest,
		response: ServerHttpResponse,
		wsHandler: WebSocketHandler,
		attributes: MutableMap<String, Any>
	): Boolean {
		val a = 1
		log.info("进入拦截器1")
		return true
	}

	override fun afterHandshake(
		request: ServerHttpRequest,
		response: ServerHttpResponse,
		wsHandler: WebSocketHandler,
		exception: Exception?
	) {
		log.info("进入拦截器2")
		val a = 1
	}


}
